//
//  BaikeViewController.m
//  news
//
//  Created by lanou on 15/12/19.
//  Copyright © 2015年 lanou. All rights reserved.
//

#import "BaikeViewController.h"

@interface BaikeViewController ()

@property (nonatomic, strong) UIWebView *webView;

@end

@implementation BaikeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, kWidth, kHeight)];
    
    [self loadWebPageWithString:self.url];
    
    [self.view addSubview:self.webView];
    
    
    UIBarButtonItem *left = [[UIBarButtonItem alloc] initWithTitle:@"返回" style:(UIBarButtonItemStylePlain) target:self action:@selector(back)];
    
    self.navigationItem.leftBarButtonItem = left;
    
    // Do any additional setup after loading the view.
}

- (void)loadWebPageWithString:(NSString*)urlString
{
    NSURL *url =[NSURL URLWithString:urlString];
    NSURLRequest *request =[NSURLRequest requestWithURL:url];
    [self.webView loadRequest:request];

}

- (void)back
{
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
